<template>
  <view class="template-index tn-safe-area-inset-bottom">
	  <view class="nav-header">
	    <text class="nav-title">服务</text>
	  </view>
    <view class="" 
	style="background-image: url('');
	 background-size: cover;
	 background-position: center;
	  border-radius: 15rpx;
	  margin: 30rpx;">
	  <image src="../../static/学校logo.jpg" 
	  
	  style="width: 100%;height: 60px;margin-right: 15rpx;"></image>
      <view class="tn-text-bold" style="font-size: 45rpx;color: #1F4D4B;text-align: center;">校友服务大厅</view>
      <view class=" tn-padding-top-sm" style="color: #1F4D4B;text-align: center; ">母校是家，欢迎校友回家</view>
    </view>
    <view class="">
      
      <view class="tn-info__container tn-flex tn-flex-wrap tn-flex-col-center tn-flex-row-between tn-margin-left tn-margin-right">
        <block v-for="(item, index) in tuniaoData" :key="index">
          <view class="tn-info__item tn-flex tn-flex-direction-row tn-flex-col-center tn-flex-row-between tn-color-white tn-shadow-blur" :style="'background-color:'+ item.color +';'" @click="tn(item.url)">
            <view class="tn-info__item__left tn-flex tn-flex-direction-row tn-flex-col-center tn-flex-row-left">
              <view class="tn-info__item__left__content">
                <view class="tn-info__item__left__content--title tn-text-bold" style="font-size: 38rpx;">{{ item.title }}</view>
                <view
                  v-if="item.subtitle"
                  class="tn-info__item__left__content--data tn-padding-top-xs"
                >
                  {{ item.subtitle }}
                </view>
              </view>
            </view>
            <view class="tn-info__item__right">
              <view class="tn-info__item__right--icon">
                <template v-if="item.img">
                  <image :src="item.img" style="width: 78rpx; height: 78rpx; border-radius: 25%; object-fit: cover; display: block; opacity: 0.3;" />
                </template>
                <template v-else>
                  <view :class="[`tn-icon-${item.icon}`]"></view>
                </template>
              </view>
            </view>
            <view class="tn-info__item__bottom">
              <view class='name tn-text-sm tn-color-gray' style="margin-left: -10rpx;">
                <text class="tn-icon-code tn-padding-right-xs" style="opacity: 0;"></text>
              </view>
            </view>
          </view>
        </block>
      </view>
      
    </view>

    <view class='tn-tabbar-height'></view>
    
  </view>
</template>

<script>
  export default {
    name: 'Index',
    data(){
      return {
        isAndroid: true,
        cardCur2: 0,
        tuniaoData: [
		  {
		    title: '校友卡',
		    color: '#1F4D4B',
		    url: '/minePages/realname_authentication',
			subtitle: '身份认证',
			img: require('../../static/schoolcard.png')
		  },
          {
            title: '返校预约',
            color: '#1F4D4B',
            url: '/minePages/backSchool',
			subtitle: '登记回访',
			img: require('../../static/return.png')
          },
          {
            title: '组织架构',
            color: '#1F4D4B',
            url: '/minePages/organizationalStructure',
			subtitle: '了解协会',
			img: require('../../static/organization.png')
          },
		  {
		    title: '会员名单',
		    color: '#1F4D4B',
		    url: '/minePages/memberList',
			subtitle: '查找校友',
			img: require('../../static/number.png')
		  },
          {
            title: '我要捐赠',
            color: '#1F4D4B',
            url: '/pages/circle/donate',
			subtitle: '助力母校',
			img: require('../../static/donate_icon.png')
          },
		  {
		    title: '祝福母校',
		    color: '#1F4D4B',
            url: '/pages/circle/circle',
			subtitle: '写下祝福',
			img: require('../../static/wish1.png')
		  },
		  {
		    title: '找校友',
		    color: '#1F4D4B',
		    url: '/pages/activity/activity',
			subtitle: '拓展人脉',
			img: require('../../static/search_number.png')
		  },
		  {
		    title: '活  动',
		    color: '#1F4D4B',
            url: '/pages/preferred/preferred',
			subtitle: '精彩纷呈',
			img: require('../../static/activity1.png')
		  }
        ],
      }
    },
    created() {
      const systemInfo = uni.getSystemInfoSync()
      if (systemInfo.system.toLocaleLowerCase().includes('ios')) {
        this.isAndroid = false
      } else {
        this.isAndroid = true
      }
    },
    methods: {
      cardSwiper(e) {
        this.cardCur = e.detail.current
      },
      tn(e) {
      	uni.navigateTo({
      		url: e,
      	});
      },
    }
  }
</script>

<style lang="scss" scoped>
  .template-index{
    max-height: 100vh;
  }
  .tn-tabbar-height {
  	min-height: 100rpx;
  	height: calc(120rpx + env(safe-area-inset-bottom) / 2);
  }
  /* 顶部导航栏 */
  .nav-header {
    background: #FFFFFF;
    height: 100rpx;
    padding-top: calc(env(safe-area-inset-top));
    box-sizing: content-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
    
    .nav-title {
      font-size: 36rpx;
      font-weight: bold;
      color: #1F4D4B;
      letter-spacing: 2rpx;
    }
  }
  
  /* 业务展示 start */
  .tn-info {
    
    &__container {
      margin-top: 10rpx;
      margin-bottom: 50rpx;
    }
    
    &__item {
      width: 47.7%;
      margin: 15rpx 0rpx 30rpx 0rpx;
      padding: 40rpx 30rpx;
      border-radius: 10rpx;
      
  
        position: relative;
        z-index: 1;
        
        &::after {
          content: " ";
          position: absolute;
          z-index: -1;
          width: 100%;
          height: 100%;
          left: 0;
          bottom: 0;
          border-radius: inherit;
          opacity: 1;
          transform: scale(1, 1);
          background-size: 100% 100%;
        }
      
      &__left {
        
        &--icon {
          width: 80rpx;
          height: 80rpx;
          border-radius: 50%;
          font-size: 40rpx;
          margin-right: 20rpx;
          position: relative;
          z-index: 1;
          
          &::after {
            content: " ";
            position: absolute;
            z-index: -1;
            width: 100%;
            height: 100%;
            left: 0;
            bottom: 0;
            border-radius: inherit;
            opacity: 1;
            transform: scale(1, 1);
            background-size: 100% 100%;
          }
        }
        
        &__content {
          font-size: 25rpx;          
          
          &--data {
            color: rgba(255,255,255,0.5);
            margin-top: 5rpx;
            // font-weight: bold;
          }
        }
      }
      
      &__right {
        display: flex;
        align-items: center;
        justify-content: flex-end; /* 将内容推到右侧 */
        height: 100%; /* 确保占满高度 */
      }
      &__bottom {
        box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.12);
        border-radius: 0 0 10rpx 10rpx;
        position: absolute;
        width: 85%;
        line-height: 15rpx;
        left: 50%;
        bottom: -15rpx;
        transform: translateX(-50%);
        z-index: -1;
        text-align: center;
      }
    }
  }
  .tn-info__item__right--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }
  .tn-info__item__right--icon image {
    border-radius: 50%;
    object-fit: cover;
    display: block;
  }
  /* 业务展示 end */
  
</style>